package com.yupi.yuapicommon.utils;

import cn.hutool.crypto.digest.DigestAlgorithm;
import cn.hutool.crypto.digest.Digester;

import java.util.Map;

/**
 * 签发算法工具类
 * @author zz_source
 * @creat 2023-01-09-3:40
 */
public class SignUtils {
    public static String getSign(Map<String, String> hashMap, String secretKey) {
        Digester sha256 = new Digester(DigestAlgorithm.SHA256);
        String string = hashMap.toString() + "." + secretKey;
        return sha256.digestHex(string);
    }

    //public static String getSign(String body, String secretKey) {
    //    return MD5.create().digestHex(JSONUtil.toJsonStr(body) + '.' + secretKey);
    //}
}
